package com.lixw.saa.config;

import com.lixw.saa.util.DateTimeTools;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.support.ToolCallbacks;
import org.springframework.ai.tool.ToolCallback;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName: LLMConfig
 * @Description:
 * @Author: xuweiLi
 * @Create: 2025/10/4 15:30
 **/
@Configuration
public class LLMConfig {
    @Bean
    public ChatClient chatClient(ChatModel chatModel)
    {
        ToolCallback[] toolCallbacks = ToolCallbacks.from(new DateTimeTools());
        return ChatClient.builder(chatModel).defaultToolCallbacks(toolCallbacks).build();
    }

}